<%@ Page Language="vb" AutoEventWireup="true" CodeBehind="FormViewForm.aspx.vb" Inherits="QSWebApplicationVB.FormViewForm" %>

<%@ Register Assembly="ValidationFramework" Namespace="ValidationFramework.Web" TagPrefix="cc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>Validation Demo</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
        <asp:FormView ID="personFormView" runat="server" DefaultMode="Edit" DataSourceID="personObjectDataSource" CellPadding="4" ForeColor="#333333" OnItemUpdating="personFormView_ItemUpdating" >
            <EditItemTemplate>
                <table>
                <tr>
                    <td>First Name:</td>
                    <td>
                        <asp:TextBox ID="firstNameTextBox" runat="server" Text='<%# Bind("FirstName") %>'/>
                    </td>
                </tr>
                <tr>
                    <td>Last Name:</td>
                    <td>
                        <asp:TextBox ID="lastNameTextBox" runat="server" Text='<%# Bind("LastName") %>'/>
                    </td>
                </tr>
                <tr>
                    <td>Age:</td>
                    <td>
                        <asp:TextBox ID="ageTextBox" runat="server" Text='<%# Bind("Age") %>'/>
                    </td>
                </tr>
                <tr>
                    <td>Email:</td>
                    <td>
                        <asp:TextBox ID="emailAddressTextBox" runat="server" Text='<%# Bind("EmailAddress") %>'/>
                    </td>
                </tr>
                <tr>
                    <td>Phone:</td>
                    <td>
                        <asp:TextBox ID="phoneNumberTextBox" runat="server" Text='<%# Bind("PhoneNumber") %>'/>
                    </td>
                </tr>
                <tr>
                    <td>Card Type:</td>
                    <td>
                        <asp:DropDownList ID="cardTypeDropDownList" runat="server" SelectedValue='<%#Bind("CardType") %>'>
                            <asp:ListItem Selected="true" Value="Invalid" Text="(Select)" />
                            <asp:ListItem Value="Visa" Text="Visa" />
                            <asp:ListItem Value="MasterCard" Text="Mastercard" />
                            <asp:ListItem Value="Amex" Text="Amex" />
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td>Card Number:</td>
                    <td>
                        <asp:TextBox ID="creditCardNumberTextBox" runat="server" Text='<%#Bind("CreditCardNumber") %>' />&nbsp;
                    </td>
                </tr>
                <tr>
                    <td>Order Total Price:</td>
                    <td>
                        <asp:TextBox ID="orderTotalTextBox" runat="server" Text='<%#Bind("OrderTotal") %>' />
                    </td>
                </tr>
                <tr>
                    <td><asp:LinkButton ID="updateLinkButton" CausesValidation="true" runat="server" Text="Update" CommandName="Update" /></td>
                    <td><asp:LinkButton ID="cancelLinkButton" CausesValidation="false" runat="server" Text="Cancel" CommandName="Cancel" /></td>
                </tr>
                </table>
           
            </EditItemTemplate>
            <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
            <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
            <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
            <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
        </asp:FormView>
			<br />
			&nbsp;&nbsp;
			<asp:Label ID="errorsLabel" runat="server"></asp:Label>
        
        <asp:ObjectDataSource ID="personObjectDataSource" runat="server" DataObjectTypeName="QSBusinessLayerVB.Person" SelectMethod="GetItem" TypeName="QSBusinessLayerVB.PersonMapper" UpdateMethod="SaveOrUpdate" OnUpdated="OnPersonSourceUpdated" >
            <SelectParameters>
                <asp:Parameter DefaultValue="0" Name="id" Type="Int32" />
            </SelectParameters>
        
        </asp:ObjectDataSource>
      <cc1:PropertyValidatorGeneratorControl id="validatorGenerator" runat="server" typetovalidate="QSBusinessLayerVB.Person,QSBusinessLayerVB" OnTargetObjectRequired="validatorGenerator_TargetObjectRequired"></cc1:PropertyValidatorGeneratorControl>
    </div>
    </form>
</body>
</html>
